package com.bfly.mall.product.enums;

/**
 * 运费计价方式--系统当前只支持按件数计价
 * 包邮计价条件--系统当前支持 按件数（满多少件），按金额（满多少金额），按件数+金额（件数满多少或金额满多少）包邮
 * @author 长沙商脉科技有限公司
 * @date 2020/4/27 14:14
 */
public enum PricingMethodEnum {
    PIECE(1, "按件数"),
    MONEY(2, "按金额"),
    WEIGHT(3, "按重量"),
    VOLUME(4, "按体积"),

    PIECE_MONEY(5,"按件数或金额");

    private int id;
    private String name;

    PricingMethodEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static PricingMethodEnum getPricingMethod(int id) {
        for (PricingMethodEnum status : PricingMethodEnum.values()) {
            if (id == status.getId()) {
                return status;
            }
        }
        return null;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
